import 'package:flutter_shop/http/http.dart';
import 'package:flutter_shop/pages/base/common_result.dart';
import 'package:flutter_shop/pages/home/home_tab_page/entity/home_content_data.dart';
import 'package:flutter_shop/pages/home/home_tab_page/entity/home_hot_data.dart';

///首页相关model
class HomeModel {
  ///获取首页数据
  Future<HomeContentData> getHomeContent() async {
    CommonResult<HomeContentData> result = await Http().post("homePageContent", data: {"name": "张三"});
    return result.data;
  }

  ///获取首页热门
  Future<List<HomeHotData>> getHomeHotList(int currentIndex) async {
    CommonResult<List<HomeHotData>> result = await Http().post("homePageBelowConten", data: {"page": currentIndex});
    return result.data;
  }
}
